package com.cipe.cmrs.view.pdf;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.view.document.AbstractPdfView;

import com.lowagie.text.Document;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfWriter;

/**
 * Sample pdf view. Please create a separate class/view for every pdf format
 * given by the client.
 * 
 * @author Allan Ramirez (ramirezag@gmail.com)
 * 
 */
public class SamplePdfView extends AbstractPdfView {
    protected void buildPdfDocument(Map<String, Object> model, Document document, PdfWriter writer, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

        String content = (String) model.get("content");
        document.add(new Phrase(content));
    }
}
